package com.hk.commons.poi.excel.read.sax;

import com.hk.commons.poi.excel.metadata.Title;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @author Kevin
 */
@Getter
@Setter
public class ReadContext {

    /**
     * 当前读取的sheet最大行
     */
    private Integer maxRow;

    /**
     * 当前读取的sheetIndex
     */
    private Integer currentSheetIndex;

    /**
     * 当前读取的 sheetName
     */
    private String currentSheetName;

    private List<Title> titleList;

    /**
     * 单元格的值
     */
    private Map<Number, String> columnValueMap = new HashMap<>();

    public int getMaxColumnIndex() {
        return Objects.isNull(titleList) ? -1 : titleList.size();
    }
}
